package day05.regularExpression;

/**
 * @author yangwenqi
 * @decs TODO
 * @date 2025/4/25
 * 2.使用正则表达式切割字符串
 * 192.168.105.27 按照  . 号切割字符串
 * 18 22 40 65 按照空格切割字符串
 */
import java.util.Arrays;

public class Test2 {
    public static void main(String[] args) {
        String s1 = "192.168.105.27";
        String[] arr1  = s1.split("\\.");
        System.out.println("按点号切割结果: " + Arrays.toString(arr1));
        String s2 = "18 22    40 65";
        String[] arr2 = s2.split("\\s+");
        System.out.println("按空格切割结果: " + Arrays.toString(arr2));
    }
}
